#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/9/26 17:44
# @Author : 闫峰
# @File    : 111.py
from common.setting import ensure_path_sep
from third_services.allegro.RebatyesAndPromotions.offerdetails import OfferDetails
from utils.mysqlUtils.db_pool import Database

znkd_db = Database(ensure_path_sep("\\config\\znkd_mysql_config.yaml"), "znkd_database_prod")
if __name__ == '__main__':
     sql = """
     SELECT
	OrderSourceId,ProductId
FROM
	m_allegro_Parameterupdate_queue 
WHERE
	`status` = 1 
	and sku='15833571'
	AND failurelog=""
	ORDER BY id DESC 
     """
     res = znkd_db.fetch_all_tuple(sql, ())
     for data in res:
          res1 = OfferDetails().get_offer_details(data[0], data[1])
          productSet = res1.get('productSet')[0].get('product').get('parameters')
          print()